package cn.com.bod.fas.common.constant.enumconst;

/**
 * @description 贷款申请状态枚举值
 * @author chenyuanxian
 * @date 2019年9月15日 下午6:12:50
 * @version 1.0.0
 * @Copyright (c) scfhdt
 */

public enum LoanStatusEnum {

    UNSUBMITTED("1", "待提交"),
    UNCHECK("2","待审核"),
    FRISTAUDITAPPROVE("3","待风控审批"),
    SAFECHECKAPPROVE("4","待评估"),
    ALREADYASSESS("5","待确认"),
    ALREADYAFFIRM("6","待复审"),
    RECHECKAPPROVE("7","待转资方"),
    WAITEFUNDORGAPPROVE("8","待入库"),
    RECEIVE("9","待签订"),
    SIGNED("10","待放款"),
    DRAWDOWN("11","资方已放款"),
    ALREADYRUTURN("12","已打回"),
    ALREADYABANDON("13","已作废"),
    REFUSE("14","已拒绝");

    private String code;

    private String msg;

    LoanStatusEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    /**
     * @description 获取响应报文返回码枚举值
     * @author chenyuanxian
     * @date 2019年9月25日 下午3:23:19
     * @param code
     * @return 响应报文返回码枚举值
     */
    public static LoanStatusEnum codeOf(String code) {
        for (LoanStatusEnum loanStatusEnum : values()) {
            if (loanStatusEnum.getCode() == code) {
                return loanStatusEnum;
            }
        }
        return null;
    }

    /**
     * @description 获取响应报文返回码枚举值中文描述
     * @author chenyuanxian
     * @date 2019年9月25日 下午3:24:37
     * @param code
     * @return
     */

    public static String valueOfI(String code) {
        for (LoanStatusEnum loanStatusEnum : values()) {
            if (loanStatusEnum.getCode() == code) {
                return loanStatusEnum.getMsg();
            }
        }
        return "";
    }

}

